library ZFacing

function SetEffectZFacing takes unit dummy, real angle returns nothing
	local integer i = R2I((angle - R2I(angle / 360) * 360) * 0.7 + 0.5)
	if i > 0 then
		call SetUnitAnimationByIndex(dummy, i)
	else
		call SetUnitAnimationByIndex(dummy, i + 252)
	endif
endfunction

endlibrary